package com.j283_5.wisdom_park.controller.visitor_management;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.j283_5.wisdom_park.common.result.ResultData;
import com.j283_5.wisdom_park.pojo.VisitRecord;
import com.j283_5.wisdom_park.pojo.Visitors;
import com.j283_5.wisdom_park.vo.visitor_management.VisitRecordVo;
import com.j283_5.wisdom_park.vo.visitor_management.VisitorsVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 蒋翔
 * @since 2022-04-29
 */
@RestController
@RequestMapping("/visit-record")
@Api(value = "访客进出记录",tags = "访客进出记录",produces="蒋翔")
public class VisitRecordController {
    @RequestMapping(value = "/visitRecordList" , method = RequestMethod.GET)
    @ApiOperation(value = "访客进出记录",notes = "查询访客进出记录（分页）",produces="蒋翔", response = ResultData.class)
    public ResultData visitRecordList(@Param("page") Page<Visitors> page, @Param("visitRecord") VisitRecord visitRecord){
        List<VisitRecordVo> visitRecordVoList = new ArrayList<>();
        VisitRecordVo visitRecordVo1 = new VisitRecordVo(1, "张三", "18767256412", "企业", "****公司",new Timestamp(System.currentTimeMillis()), "出场", new Timestamp(System.currentTimeMillis()) );
        VisitRecordVo visitRecordVo2 = new VisitRecordVo(2, "李四", "18767256413", "企业", "****公司",new Timestamp(System.currentTimeMillis()), "进场" );
        visitRecordVoList.add(visitRecordVo1);
        visitRecordVoList.add(visitRecordVo2);
        return ResultData.ok().data(visitRecordVoList);
    }
}

